/* color palette from <https://github.com/vuejs/theme> */
:root {
  --vt-c-white: #ffffff;
  --vt-c-white-soft: #f8f8f8;
  --vt-c-white-mute: #f2f2f2;

  --vt-c-black: #181818;
  --vt-c-black-soft: #222222;
  --vt-c-black-mute: #282828;

  --vt-c-indigo: #2c3e50;

  --vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
  --vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
  --vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
  --vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);

  --vt-c-text-light-1: var(--vt-c-indigo);
  --vt-c-text-light-2: rgba(60, 60, 60, 0.66);
  --vt-c-text-dark-1: var(--vt-c-white);
  --vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
}

/* semantic color variables for this project */
:root {
  --color-background: var(--vt-c-white);
  --color-background-soft: var(--vt-c-white-soft);
  --color-background-mute: var(--vt-c-white-mute);

  --color-border: var(--vt-c-divider-light-2);
  --color-border-hover: var(--vt-c-divider-light-1);

  --color-heading: var(--vt-c-text-light-1);
  --color-text: var(--vt-c-text-light-1);

  --section-gap: 160px;
}

/* 全局主题变量 */
:root {
  --color-bg: #f7f9fc;
  --color-card: #fff;
  --color-text: #1a2a6c;
  --color-subtext: #4a6491;
  --color-primary: #4361ee;
  --color-border: #e4e7ed;
}
[data-theme="dark"] {
  --color-bg: #181c24;
  --color-card: #232a36;
  --color-text: #e6eaf3;
  --color-subtext: #b0b8c9;
  --color-primary: #4361ee;
  --color-border: #2c3440;
}
[data-theme="light"] {
  --color-bg: #f7f9fc;
  --color-card: #fff;
  --color-text: #1a2a6c;
  --color-subtext: #4a6491;
  --color-primary: #4361ee;
  --color-border: #e4e7ed;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-background: var(--vt-c-black);
    --color-background-soft: var(--vt-c-black-soft);
    --color-background-mute: var(--vt-c-black-mute);

    --color-border: var(--vt-c-divider-dark-2);
    --color-border-hover: var(--vt-c-divider-dark-1);

    --color-heading: var(--vt-c-text-dark-1);
    --color-text: var(--vt-c-text-dark-2);
  }
}

html, body, #app {
  width: 100vw;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* 移除overflow hidden，允许滚动 */
}

/* 移除全局滚动条隐藏，允许滚动 */
html, body {
  /* 移除overflow hidden限制 */
  overscroll-behavior: none;
}
/* 保留滚动条样式但允许滚动 */
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}
*::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}
*::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  font-weight: normal;
}

body {
  min-height: 100vh;
  color: var(--color-text);
  background: var(--color-bg);
  transition:
    color 0.5s,
    background-color 0.5s;
  line-height: 1.6;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    'Fira Sans',
    'Droid Sans',
    'Helvetica Neue',
    sans-serif;
  font-size: 15px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.card, .settings-container, .upload-card {
  background: var(--color-card);
  color: var(--color-text);
  border-color: var(--color-border);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--color-text);
}

.subtitle, .account-info, .switch-label, .app-footer {
  color: var(--color-subtext);
}

/* 按钮主色适配 */
button, .submit-button, .translate-button, .account-btn {
  border-color: var(--color-primary);
}
button.active, button:hover, .submit-button.active, .translate-button.active, .account-btn.active {
  background: var(--color-primary);
  color: #fff;
}
